"""
This module provides simple examples of a class and functions
to demonstrate Sphinx documentation for basic code elements.
"""
from auto_generate import export_to_docs


def greet(name):
    """
    Generates a greeting message.

    Args:
        name (str): The name of the person to greet.

    Returns:
        str: A greeting message.
    """
    return f"Hello, {name}!"


def add(a, b):
    """
    Adds two numbers.

    Args:
        a (int or float): The first number.
        b (int or float): The second number.

    Returns:
        int or float: The result of adding a and b.
    """
    return a + b


class Animal:
    """
    A simple class representing an animal.

    Attributes:
        name (str): The name of the animal.
        sound (str): The sound the animal makes.
    """

    def __init__(self, name, sound):
        """
        Initialize an Animal instance.

        Args:
            name (str): The name of the animal.
            sound (str): The sound the animal makes.
        """
        self.name = name
        self.sound = sound

    @export_to_docs
    def speak(self):
        """
        Returns what the animal says.

        Returns:
            str: A message indicating the animal's sound.
        """
        return f"The {self.name} says {self.sound}."
